﻿using System;
using System.Collections.Generic;
using System.Web.UI;
using OpenWaves.Web.Controls;

namespace OpenWaves.Web.Tests
{
    public partial class GoogleMapTests : Page
    {
        public readonly IEnumerable<Hospital> Hospitals = new List<Hospital>
                                                     {
                                                         new Hospital
                                                             {
                                                                 Location = new GeoPoint(0, 0),
                                                                 Name = "Hospital 1",
                                                                 Description = "Lorem ipsum dolor",
                                                                 Photo = "http://magamara.blox.pl/resource/hospital.jpg"
                                                             },
                                                         new Hospital
                                                             {
                                                                 Location = new GeoPoint(-20, 0),
                                                                 Name = "Hospital 2",
                                                                 Description = "Lorem ipsum dolor",
                                                                 Photo =
                                                                     "http://www.google.pl/intl/en_com/images/srpr/logo1w.png"
                                                             },
                                                         new Hospital
                                                             {
                                                                 Location = new GeoPoint(-21, 20),
                                                                 Name = "Hospital 3",
                                                                 Description = "Lorem ipsum dolor",
                                                                 Photo = "http://magamara.blox.pl/resource/hospital.jpg"
                                                             },
                                                         new Hospital
                                                             {
                                                                 Location = new GeoPoint(22, -20),
                                                                 Name = "Hospital 3",
                                                                 Description = "Lorem ipsum dolor",
                                                                 Photo =
                                                                     "http://www.google.pl/intl/en_com/images/srpr/logo1w.png"
                                                             }
                                                     };

    }

    public class HospitalsMap : GoogleMap<Hospital>
    {
        public HospitalsMap()
            : base(h => h.Location.Latitude, h => h.Location.Longitude, h => h.Name)
        {
        }

        [PersistenceMode(PersistenceMode.InnerProperty)]
        [TemplateContainer(typeof (GoogleMapInfoWindowContainer<Hospital>))]
        public new ITemplate InfoWindowTemplate
        {
            get { return base.InfoWindowTemplate; }
            set { base.InfoWindowTemplate = value; }
        }
    }

    public class Hospital
    {
        public GeoPoint Location { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string Photo { get; set; }
    }
}